LeftTreePanel = function() {
	var this_panel = this;
	
	var item1 = new Ext.tree.TreePanel({
		title : "奖励明细表",
		iconCls : "meun",
		rootVisible : false,
		root : {
			type : 'root',
			children : [{
				id : "sell_reward",
				iconCls : "tables",
                text: '销售奖励明细表',
                leaf: true
            },{
            	id : "back_reward",
            	iconCls : "tables",
                text: '回款奖励明细表',
                leaf: true
            },{
            	id : "sell_sum",
            	iconCls : "tables",
                text: '销售奖励季度合计',
                leaf: true
            },{
            	id : "back_sum",
            	iconCls : "tables",
                text: '回款奖励季度合计',
                leaf: true
            },{
            	id : "sellback_busi",
            	iconCls : "tables",
                text: '奖金发放合计(业务经理)',
                leaf: true
            },{
            	id : "sellback_support",
            	iconCls : "tables",
                text: '奖金发放合计(技术支持)',
                leaf: true
            },{
            	id : "sellback_manager",
            	iconCls : "tables",
                text: '奖金发放合计(事业部经理)',
                leaf: true
            },{
            	id : "sellback_team",
            	iconCls : "tables",
                text: '奖金发放合计(团队)',
                leaf: true
            },{
            	id : "person_bonus",
            	iconCls : "tables",
                text: '季度奖金汇总',
                leaf: true
            }]
		},
		listeners : {
			click : function(n){
				var id = n.attributes.id;
				if(id === "sell_reward"){
					centerPanel.getLayout().setActiveItem(sellItemDetailPanel);
				}else if(id === "back_reward"){
					centerPanel.getLayout().setActiveItem(backItemDetailPanel);
				}else if(id === "sell_sum"){
					centerPanel.getLayout().setActiveItem(sellSumSeasonPanel);
				}else if(id === "back_sum"){
					centerPanel.getLayout().setActiveItem(backSumSeasonPanel);
				}else if(id === "sellback_busi"){
					centerPanel.getLayout().setActiveItem(businessmanBonusPanel);
				}else if(id === "sellback_support"){
					centerPanel.getLayout().setActiveItem(supportBonusPanel);
				}else if(id === "sellback_manager"){
					centerPanel.getLayout().setActiveItem(managerBonusPanel);
				}else if(id === "sellback_team"){
					centerPanel.getLayout().setActiveItem(teamBonusPanel);
				}else if(id === "person_bonus"){
					centerPanel.getLayout().setActiveItem(personBonusPanel);
				}
			}
		}
	});
	
	var item2 = new Ext.tree.TreePanel({
		title : "信息管理",
		iconCls : "meun",
		rootVisible : false,
		root : {
			type : 'root',
			children : [ {
				id : "item_setting",
                text: '销售回款管理',
                leaf: true,
                iconCls : "table"
            }, {
            	id : "person_setting",
            	text : '员工信息管理',
            	leaf : true,
            	iconCls : "person"
            }, {
            	id : "base_setting",
                text: '基本配置管理',
                leaf: true,
                iconCls : "action"
            }]
		},
		listeners : {
			click : function(n){
				var id = n.attributes.id;
				if(id === "item_setting"){
					centerPanel.getLayout().setActiveItem(setDetailPanel);
				}else if(id === "base_setting"){
					centerPanel.getLayout().setActiveItem(configurationPanel);
				}else if(id === "person_setting"){
					centerPanel.getLayout().setActiveItem(personPanel);
				}
			}
		}
	});
	
	var item3 = new Ext.tree.TreePanel({
		title : "管理员配置",
		iconCls : "meun",
		rootVisible : false,
		root : {
			type : 'root',
			children : [{
				id : "manager_setting",
            	text : "管理员配置",
            	leaf: true,
            	iconCls : "manager"
            }]
		},
		listeners : {
			click : function(n){
				var id = n.attributes.id;
				if(id === "manager_setting"){
					centerPanel.getLayout().setActiveItem(managerPanel);
				}
			}
		}
	}); 
	
	
	this.item1 = item1;
	this.item2 = item2;
	this.item3 = item3;
	
	LeftTreePanel.superclass.constructor.call(this, {
		region : 'west',
		width : 200,
		iconCls : "home",
		title : '导航栏',
		split: true,
		containerScroll : true,
		collapsible: true,
//		collapseMode: 'mini',
		layout:'accordion',
		layoutConfig: {
	        animate: true
	    },
		items : [item1, item2, item3]
	});
};
Ext.extend(LeftTreePanel, Ext.Panel);
var leftTreePanel = new LeftTreePanel();